//
//  UIView+Additions.m
//  ChatRoom_Demo
//
//  Created by 李红 on 14-11-2.
//
//

#import "UIView+Additions.h"

@implementation UIView (Additions)

-(UITableViewCell *)viewTableViewCell
{
    UIResponder *next = self.nextResponder;
    while (next != nil) {
        if ([next isKindOfClass:[UITableViewCell class]]) {
            
            return (UITableViewCell *)next;
        }
        
        next = next.nextResponder;
    }
    
    return nil;
}

-(UIViewController *)viewController
{
    UIResponder *next = self.nextResponder;
    while (next != nil) {
        if ([next isKindOfClass:[UIViewController class]]) {
            
            return (UIViewController *)next;
        }
        
        next = next.nextResponder;
    }
    
    return nil;
}

@end
